#include <iostream>
#include <exception>

using namespace std;

class TestC{
public:
	TestC(){
        p = new char[1024];
        throw std::exception("test exception");
    }
    ~TestC(){
        std::cout << "deconstruct\r\n";
    }
    char *p;
};

int main(){
    try
    {
        TestC p2;
    }
    catch(const std::exception& e)
    {
        std::cerr << e.what() << '\n';
    }
    
}